home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / s_to_z / tpack / forminfo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-09-15  |  1.9 KB  |  79 lines

  1. unit Docomps;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, Grids, Buttons, Toolbar, ExtCtrls;
  8.  
  9. type
  10.   TDocumentComponents = class(TForm)
  11.     Toolbar1: TToolbar;
  12.     ToolButton1: TToolButton;
  13.     StringGrid1: TStringGrid;
  14.     procedure ToolButton1Click(Sender: TObject);
  15.     procedure FormActivate(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   DocumentComponents: TDocumentComponents;
  24.  
  25. implementation
  26.  
  27. uses SixDs,tbltimed,pasutils;
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TDocumentComponents.ToolButton1Click(Sender: TObject);
  32. begin
  33.   close;
  34. end;
  35.  
  36. procedure TDocumentComponents.FormActivate(Sender: TObject);
  37. var
  38.   i,n:integer;
  39. begin
  40.   with StringGrid1 do begin
  41.     ColCount:=4;
  42.     cells[0,0]:='#';
  43.     cells[1,0]:='Class';
  44.     cells[2,0]:='Name';
  45.     cells[3,0]:='Value';
  46.     ColWidths[0]:=40;
  47.     n:=width-ColWidths[0]-5*GridLineWidth;
  48.     i:=n div 3;
  49.     ColWidths[1]:=i;
  50.     ColWidths[2]:=i;
  51.     ColWidths[3]:=n-2*i;
  52.     with DSForm do begin
  53.       n:=ComponentCount;
  54.       RowCount:=n;
  55.       DefaultRowHeight:=18;
  56.       DocumentComponents.ClientHeight:= RowCount * (DefaultRowHeight+GridLineWidth)
  57.         + DocumentComponents.Toolbar1.Height +GridLineWidth;
  58.       for i:=1 to n do
  59.         with rows[i] do begin
  60.           Strings[0]:=inttostr(i);
  61.           if components[i-1] is TTableTStamped then
  62.             with TTableTStamped(components[i-1]) do begin
  63.               Strings[1]:=ClassName;
  64.               Strings[2]:=Name;
  65.               Strings[3]:=inttostr(instancesize); {boolstring[(LoginTableInfo=nil)];}
  66.               end
  67.           else
  68.             with components[i-1] do begin
  69.               Strings[1]:=ClassName;
  70.               Strings[2]:=Name;
  71.               Strings[3]:=inttostr(instancesize);
  72.               end;
  73.           end;
  74.       end;
  75.     end;
  76. end;
  77.  
  78. end.
  79.